{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table>\n",
       "<tr>\n",
       "<td id=\"left\"></td><td>This is benzene</td>\n",
       "</tr>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%html\n",
    "<table>\n",
    "<tr>\n",
    "<td id=\"left\"></td><td>This is benzene</td>\n",
    "</tr>\n",
    "</table>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/home/dkoes/git/3Dmol.js/py3Dmol/build/lib\n"
     ]
    }
   ],
   "source": [
    "cd build/lib"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/3dmoljs_load.v0": "<div id=\"3dmolviewer_1676050474639691\"  style=\"position: relative; width: 640px; height: 480px\">\n        <p id=\"3dmolwarning_1676050474639691\" style=\"background-color:#ffcccc;color:black\">You appear to be running in JupyterLab (or JavaScript failed to load for some other reason).  You need to install the 3dmol extension: <br>\n        <tt>jupyter labextension install jupyterlab_3dmol</tt></p>\n        </div>\n<script>\n\nvar loadScriptAsync = function(uri){\n  return new Promise((resolve, reject) => {\n    //this is to ignore the existence of requirejs amd\n    var savedexports, savedmodule;\n    if (typeof exports !== 'undefined') savedexports = exports;\n    else exports = {}\n    if (typeof module !== 'undefined') savedmodule = module;\n    else module = {}\n\n    var tag = document.createElement('script');\n    tag.src = uri;\n    tag.async = true;\n    tag.onload = () => {\n        exports = savedexports;\n        module = savedmodule;\n        resolve();\n    };\n  var firstScriptTag = document.getElementsByTagName('script')[0];\n  firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n});\n};\n\nif(typeof $3Dmolpromise === 'undefined') {\n$3Dmolpromise = null;\n  $3Dmolpromise = loadScriptAsync('https://cdnjs.cloudflare.com/ajax/libs/3Dmol/2.0.1/3Dmol-min.min.js');\n}\n\nvar viewer_1676050474639691 = null;\nvar warn = document.getElementById(\"3dmolwarning_1676050474639691\");\nif(warn) {\n    warn.parentNode.removeChild(warn);\n}\n$3Dmolpromise.then(function() {\nviewer_1676050474639691 = $3Dmol.createViewer(document.getElementById(\"3dmolviewer_1676050474639691\"),{backgroundColor:\"white\"});\nviewer_1676050474639691.zoomTo();\n\tviewer_1676050474639691.addModel([\"\\n     RDKit          3D\\n\\n  6  6  0  0  0  0  0  0  0  0999 V2000\\n   -0.9517    0.7811   -0.6622 C   0  0  0  0  0  0  0  0  0  0  0  0\\n    0.2847    1.3329   -0.3121 C   0  0  0  0  0  0  0  0  0  0  0  0\\n    1.2365    0.5518    0.3512 C   0  0  0  0  0  0  0  0  0  0  0  0\\n    0.9517   -0.7811    0.6644 C   0  0  0  0  0  0  0  0  0  0  0  0\\n   -0.2847   -1.3329    0.3144 C   0  0  0  0  0  0  0  0  0  0  0  0\\n   -1.2365   -0.5518   -0.3489 C   0  0  0  0  0  0  0  0  0  0  0  0\\n  1  2  2  0\\n  2  3  1  0\\n  3  4  2  0\\n  4  5  1  0\\n  5  6  2  0\\n  6  1  1  0\\nM  END\\n$$$$\", \"sdf\"],{});\n\tviewer_1676050474639691.setStyle([{\"stick\": {}}],{});\n\tviewer_1676050474639691.zoomTo([],{});\nviewer_1676050474639691.render();\n});\n</script><script>document.getElementById(\"left\").append(document.getElementById(\"3dmolviewer_1676050474639691\")); </script>",
      "text/html": [
       "<div id=\"3dmolviewer_1676050474639691\"  style=\"position: relative; width: 640px; height: 480px\">\n",
       "        <p id=\"3dmolwarning_1676050474639691\" style=\"background-color:#ffcccc;color:black\">You appear to be running in JupyterLab (or JavaScript failed to load for some other reason).  You need to install the 3dmol extension: <br>\n",
       "        <tt>jupyter labextension install jupyterlab_3dmol</tt></p>\n",
       "        </div>\n",
       "<script>\n",
       "\n",
       "var loadScriptAsync = function(uri){\n",
       "  return new Promise((resolve, reject) => {\n",
       "    //this is to ignore the existence of requirejs amd\n",
       "    var savedexports, savedmodule;\n",
       "    if (typeof exports !== 'undefined') savedexports = exports;\n",
       "    else exports = {}\n",
       "    if (typeof module !== 'undefined') savedmodule = module;\n",
       "    else module = {}\n",
       "\n",
       "    var tag = document.createElement('script');\n",
       "    tag.src = uri;\n",
       "    tag.async = true;\n",
       "    tag.onload = () => {\n",
       "        exports = savedexports;\n",
       "        module = savedmodule;\n",
       "        resolve();\n",
       "    };\n",
       "  var firstScriptTag = document.getElementsByTagName('script')[0];\n",
       "  firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n",
       "});\n",
       "};\n",
       "\n",
       "if(typeof $3Dmolpromise === 'undefined') {\n",
       "$3Dmolpromise = null;\n",
       "  $3Dmolpromise = loadScriptAsync('https://cdnjs.cloudflare.com/ajax/libs/3Dmol/2.0.1/3Dmol-min.min.js');\n",
       "}\n",
       "\n",
       "var viewer_1676050474639691 = null;\n",
       "var warn = document.getElementById(\"3dmolwarning_1676050474639691\");\n",
       "if(warn) {\n",
       "    warn.parentNode.removeChild(warn);\n",
       "}\n",
       "$3Dmolpromise.then(function() {\n",
       "viewer_1676050474639691 = $3Dmol.createViewer(document.getElementById(\"3dmolviewer_1676050474639691\"),{backgroundColor:\"white\"});\n",
       "viewer_1676050474639691.zoomTo();\n",
       "\tviewer_1676050474639691.addModel([\"\\n     RDKit          3D\\n\\n  6  6  0  0  0  0  0  0  0  0999 V2000\\n   -0.9517    0.7811   -0.6622 C   0  0  0  0  0  0  0  0  0  0  0  0\\n    0.2847    1.3329   -0.3121 C   0  0  0  0  0  0  0  0  0  0  0  0\\n    1.2365    0.5518    0.3512 C   0  0  0  0  0  0  0  0  0  0  0  0\\n    0.9517   -0.7811    0.6644 C   0  0  0  0  0  0  0  0  0  0  0  0\\n   -0.2847   -1.3329    0.3144 C   0  0  0  0  0  0  0  0  0  0  0  0\\n   -1.2365   -0.5518   -0.3489 C   0  0  0  0  0  0  0  0  0  0  0  0\\n  1  2  2  0\\n  2  3  1  0\\n  3  4  2  0\\n  4  5  1  0\\n  5  6  2  0\\n  6  1  1  0\\nM  END\\n$$$$\", \"sdf\"],{});\n",
       "\tviewer_1676050474639691.setStyle([{\"stick\": {}}],{});\n",
       "\tviewer_1676050474639691.zoomTo([],{});\n",
       "viewer_1676050474639691.render();\n",
       "});\n",
       "</script><script>document.getElementById(\"left\").append(document.getElementById(\"3dmolviewer_1676050474639691\")); </script>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import py3Dmol\n",
    "\n",
    "benz='''\n",
    "     RDKit          3D\n",
    "\n",
    "  6  6  0  0  0  0  0  0  0  0999 V2000\n",
    "   -0.9517    0.7811   -0.6622 C   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "    0.2847    1.3329   -0.3121 C   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "    1.2365    0.5518    0.3512 C   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "    0.9517   -0.7811    0.6644 C   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "   -0.2847   -1.3329    0.3144 C   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "   -1.2365   -0.5518   -0.3489 C   0  0  0  0  0  0  0  0  0  0  0  0\n",
    "  1  2  2  0\n",
    "  2  3  1  0\n",
    "  3  4  2  0\n",
    "  4  5  1  0\n",
    "  5  6  2  0\n",
    "  6  1  1  0\n",
    "M  END\n",
    "$$$$'''\n",
    "view = py3Dmol.view()\n",
    "view.addModel(benz,'sdf')\n",
    "view.setStyle({'stick':{}})\n",
    "view.zoomTo()\n",
    "view.insert('left')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import py3Dmol\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "u'/home/dkoes/git/3Dmol.js/py3Dmol'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pwd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
